package com.qf.common.core.config;

/**
 * 天--道--酬--勤
 *
 * @author LiangGaoQiang
 * @ClassName WebConfig
 * @Date: 2025/5/22 下午5:40
 * @Description: 描述
 */

import com.qf.common.core.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Resource
    private LoginInterceptor LoginInterceptor;

    /**
     * 拦截器的注册
     *
     * @param registry 注册器
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(LoginInterceptor)
                // .excludePathPatterns("/user/findAllParentUsers")
                .addPathPatterns("/**"); // 拦截所有路径

    }
}

